

********** This program generates the results in Table A3 of the paper: robustness check controlling for lagged outcome variable **********


clear all
set more off, permanently
cd $localdir\Data"
global output "$localdir\Output"






***************************************************** ASSESSMENT OF NATIONAL UNEMPLOYMENT RATE ******************************************************

* Outcome only available in 2011 and 2012

use "National Unemployment RF for Analysis - Last Year.dta", clear

bysort unique year: egen grossunemp_enter_network_share=mean(grossunemp_enter_network)
drop *_network
duplicates drop unique year, force

tab year 

lab var grossunemp_enter_network_share "Unemployment shock (network share)"

replace unemp_rate_estimate=unemp_rate_estimate/100

bysort unique (year): g outcome_l=unemp_rate_estimate[_n-1]

* Results
display c(current_time)
reghdfe unemp_rate_estimate grossunemp_enter_network_share outcome_l, absorb(both ind2_year ocp_year educ_year) cluster(muni)
sum unemp_rate_estimate if e(sample)==1
local mean_outcome=r(mean)
local sd_outcome=r(sd)
sum grossunemp_enter_network_share if e(sample)==1
local mean_shock=r(mean)
local sd_shock=r(sd)
outreg2 using "$output\TableA3.xls", replace nocons nor ctitle("Guess national unemployment rate") bdec(3) sdec(3) adec(3) label keep(grossunemp_enter_network_share outcome_l) ///
adds(Outcome mean,`mean_outcome', Outcome sd,`sd_outcome', Unemployment shock mean,`mean_shock',  Unemployment shock sd,`sd_shock')

display c(current_time)









***************************************************** FORECAST OF NATIONAL UNEMPLOYMENT RATE ******************************************************

* Outcome only available in 2011

use "National Unemployment Forecast RF for Analysis - Last Year.dta", clear

bysort unique year: egen grossunemp_enter_network_share=mean(grossunemp_enter_network)
drop *_network
duplicates drop unique year, force

tab year 

lab var grossunemp_enter_network_share "Unemployment shock (network share)"

replace unemp_rate_estimate_next=unemp_rate_estimate_next/100

bysort unique (year): g outcome_l=unemp_rate_estimate_next[_n-1]

* Results
display c(current_time)
reghdfe unemp_rate_estimate_next grossunemp_enter_network_share outcome_l, absorb(both ind2_year ocp_year educ_year) cluster(muni)
sum unemp_rate_estimate_next if e(sample)==1
local mean_outcome=r(mean)
local sd_outcome=r(sd)
sum grossunemp_enter_network_share if e(sample)==1
local mean_shock=r(mean)
local sd_shock=r(sd)
outreg2 using "$output\TableA3.xls", append nocons nor ctitle("National unemployment rate expectation") bdec(3) sdec(3) adec(3) label keep(grossunemp_enter_network_share outcome_l) ///
adds(Outcome mean,`mean_outcome', Outcome sd,`sd_outcome', Unemployment shock mean,`mean_shock',  Unemployment shock sd,`sd_shock')

display c(current_time)






***************************************************** UNEMPLOYMENT OUTCOMES - PROBABILITY ******************************************************

use "Unemployment Outcomes RF for Analysis - Last Year.dta", clear

bysort unique year: egen grossunemp_enter_network_share=mean(grossunemp_enter_network)
drop *_network
duplicates drop unique year, force

tab year 

lab var grossunemp_enter_network_share "Unemployment shock (network share)"

replace prob_unemployed=prob_unemployed/100

bysort unique (year): g outcome_l=prob_unemployed[_n-1]

* Results
display c(current_time)
reghdfe prob_unemployed grossunemp_enter_network_share outcome_l, absorb(both ind2_year ocp_year educ_year) cluster(muni)
sum prob_unemployed if e(sample)==1
local mean_outcome=r(mean)
local sd_outcome=r(sd)
sum grossunemp_enter_network_share if e(sample)==1
local mean_shock=r(mean)
local sd_shock=r(sd)
outreg2 using "$output\TableA3.xls", append nocons nor ctitle("Own unemployment expectation") bdec(3) sdec(3) adec(3) label keep(grossunemp_enter_network_share outcome_l) ///
adds(Outcome mean,`mean_outcome', Outcome sd,`sd_outcome', Unemployment shock mean,`mean_shock',  Unemployment shock sd,`sd_shock')

display c(current_time)






***************************************************** UNEMPLOYMENT OUTCOMES - UI POLICY ******************************************************

use "UI Outcomes RF for Analysis - Last Year.dta", clear

bysort unique year: egen grossunemp_enter_network_share=mean(grossunemp_enter_network)
drop *_network
duplicates drop unique year, force

tab year 

lab var grossunemp_enter_network_share "Unemployment shock (network share)"

bysort unique (year): g outcome_l=more_ui[_n-1]

* Results
display c(current_time)
reghdfe more_ui grossunemp_enter_network_share outcome_l, absorb(both ind2_year ocp_year educ_year) cluster(muni)
sum more_ui if e(sample)==1
local mean_outcome=r(mean)
local sd_outcome=r(sd)
sum grossunemp_enter_network_share if e(sample)==1
local mean_shock=r(mean)
local sd_shock=r(sd)
outreg2 using "$output\TableA3.xls", append nocons nor ctitle("Want more unemployment insurance") bdec(3) sdec(3) adec(3) label keep(grossunemp_enter_network_share outcome_l) ///
adds(Outcome mean,`mean_outcome', Outcome sd,`sd_outcome', Unemployment shock mean,`mean_shock',  Unemployment shock sd,`sd_shock')

display c(current_time)








***************************************************** IDEOLOGY OUTCOMES ******************************************************

use "Ideology RF for Analysis - Last Year.dta", clear

bysort unique year: egen grossunemp_enter_network_share=mean(grossunemp_enter_network)
drop *_network
duplicates drop unique year, force

tab year 

lab var grossunemp_enter_network_share "Unemployment shock (network share)"

bysort unique (year): g outcome_l=govt_more_help[_n-1]

* Results
display c(current_time)
reghdfe govt_more_help grossunemp_enter_network_share outcome_l, absorb(both ind2_year ocp_year educ_year) cluster(muni)
sum govt_more_help if e(sample)==1
local mean_outcome=r(mean)
local sd_outcome=r(sd)
sum grossunemp_enter_network_share if e(sample)==1
local mean_shock=r(mean)
local sd_shock=r(sd)
outreg2 using "$output\TableA3.xls", append nocons nor ctitle("Government should support the poor") bdec(3) sdec(3) adec(3) label keep(grossunemp_enter_network_share outcome_l) ///
adds(Outcome mean,`mean_outcome', Outcome sd,`sd_outcome', Unemployment shock mean,`mean_shock',  Unemployment shock sd,`sd_shock')

display c(current_time)









***************************************************** VOTING LEFT (INTENTION) ******************************************************

use "Voting RF for Analysis - Last Year.dta", clear

bysort unique year: egen grossunemp_enter_network_share=mean(grossunemp_enter_network)
drop *_network
duplicates drop unique year, force

tab year 

lab var grossunemp_enter_network_share "Unemployment shock (network share)"

bysort unique (year): g outcome_l=vote_left[_n-1]

* Results
display c(current_time)
reghdfe vote_left grossunemp_enter_network_share outcome_l, absorb(both ind2_year ocp_year educ_year) cluster(muni)
sum vote_left if e(sample)==1
local mean_outcome=r(mean)
local sd_outcome=r(sd)
sum grossunemp_enter_network_share if e(sample)==1
local mean_shock=r(mean)
local sd_shock=r(sd)
outreg2 using "$output\TableA3.xls", append nocons nor ctitle("Intend to vote for left party") bdec(3) sdec(3) adec(3) label keep(grossunemp_enter_network_share outcome_l) ///
adds(Outcome mean,`mean_outcome', Outcome sd,`sd_outcome', Unemployment shock mean,`mean_shock',  Unemployment shock sd,`sd_shock')

display c(current_time)



































